from typing import List

from pydantic import BaseModel
from enum import Enum

class ResultEnum(str, Enum):
    SUCCESS = 1
    FAILURE = 2
# user response model
class ResultModel(BaseModel):
    result: ResultEnum = ResultEnum.SUCCESS
    # code:str

class UpdateModel(BaseModel):
    result: ResultEnum = ResultEnum.SUCCESS

class UserModel(BaseModel):
    id:int
    mobile: str
    username:str
    avatar: str
    is_active: bool
    is_staff: bool

class LoginedModel(BaseModel):
    user: UserModel
    access_token: str
    refresh_token: str

class UpdatedAvatar(BaseModel):
    file_url: str
# address response model
class AddressModel(BaseModel):
    id: str
    realname: str
    mobile: str
    detail: str
    region: str

class AddressesListModel(BaseModel):
    addresses: List[AddressModel]